package chapter06

import scala.beans.BeanProperty

/**
 *
 * @author cdhuangchao3
 * @date 2023/6/9 5:24 PM
 */
object Test03_Class {
  def main(args: Array[String]): Unit = {
    val student = new Student()
    //    student.name // error
    println(student.age)
    println(student.sex)
    student.sex = "female"
    println(student.sex)
  }
}

// 定义一个类
class Student {
  // 定义属性
  private var name = "alice"
  @BeanProperty
  val age = 10
  var sex: String = _
}